package com.goldgov.jsondoc.revsoler.impl;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

import com.goldgov.jsondoc.revsoler.JsonRevsoler;

public class FileJsonRevsoler implements JsonRevsoler {
	
	public String getJsonFromUrl(String url)throws Exception  {
		File file = new File(url);
		InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), "UTF-8");
		BufferedReader bufferReader = new BufferedReader(inputStreamReader);
		
		StringBuffer sb = new StringBuffer();
		String text = null;
		while((text = bufferReader.readLine()) != null) {
			sb.append(text);
		}
		bufferReader.close();
		return sb.toString();
	}

}
